/**
 * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see https://ckeditor.com/legal/ckeditor-oss-license
 */

CKEDITOR.editorConfig = function( config ) {
	
	// %REMOVE_START%  /*移除了 image 插件*/
	// The configuration options below are needed when running CKEditor from source files.
    config.plugins = 'dialogui,dialog,about,a11yhelp,basicstyles,blockquote,notification,button,toolbar,clipboard,panel,floatpanel,menu,contextmenu,resize,elementspath,enterkey,entities,popup,filetools,filebrowser,floatingspace,listblock,richcombo,format,htmlwriter,indent,indentlist,fakeobjects,link,list,magicline,maximize,pastetext,xml,ajax,pastetools,pastefromword,removeformat,showborders,sourcearea,specialchar,stylescombo,table,tabletools,tableselection,undo,lineutils,widgetselection,widget,notificationaggregator,uploadwidget,uploadimage,autosave,copyformatting,justify,bidi,panelbutton,colorbutton,colordialog,wysiwygarea,font,indentblock,menubutton,language,liststyle,mathjax,pastefromexcel,tableresize,templates,uploadfile';
	config.skin = 'moono-lisa';
	// %REMOVE_END%

	// Define changes to default configuration here.
	// For complete reference see:
	// https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html

	// The toolbar groups arrangement, optimized for two toolbar rows.
    config.toolbar_MyToolbar =
        [
            ['Undo', 'Redo', '-'],
            ['Bold', 'Italic', 'Underline', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat'],
            ['JustifyLeft', 'JustifyCenter', 'JustifyRight'],
            ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'],
            [ 'BidiLtr', 'BidiRtl', '-', 'Blockquote'],
            ['PasteFromWord'],
            // ['NewPage', 'Preview'],
            // ['ShowBlocks', 'Maximize'],
            
            // '/',
            ['Link', 'Unlink'], ['TextColor', 'BGColor'], ['Filefinder','UploadImage2','Table', 'SpecialChar','Source','Maximize'],
            
            // ['CreatePlaceholder', 'SpecialChar', 'PageBreak', 'Smiley', 'Emojione'],
            '/',
	        ['Textindent', 'TextindentAll', 'Removeemptyline', 'Clearformat','Styles', 'Format', 'Font', 'FontSize', 'lineheight','letterspacing'],

        ];

	// Remove some buttons provided by the standard plugins, which are
	// not needed in the Standard(s) toolbar.
	//config.removeButtons = 'Underline,Subscript,Superscript';

	// Set the most common block elements.
	//config.format_tags = 'p;h1;h2;h3;pre';

	// Simplify the dialog windows.
	//config.removeDialogTabs = 'image:advanced;link:advanced';
	
	    /*是否对编辑框里添加的源码进行过滤（false:过滤，true:禁用过滤）*/
    config.allowedContent = true;
    config.tabSpaces = 4; // 当用户键入TAB时，编辑器走过的空格数，当值为0时，焦点将移出编辑框
    config.disableObjectResizing = false;
    config.removeDialogTabs = 'image:advanced;link:advanced';
    config.font_names = '宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑;' + config.font_names;
    config.height = '420px';
    config.toolbar = 'MyToolbar';
    config.extraPlugins = 'lineheight,textindent,textindentall,clearformat,removeemptyline,textselectindent,image2,uploadimage2,filefinder,letterspacing'; //autosave
    config.removePlugins = 'autosave,pastefromexcel';

    config.line_height="100%;110%;120%;130%;140%;150%;160%;170%;180%;190%;200%;220%;240%;260%;280%;300%;320%;340%;360%;380%;400%;433%;466%;500%";
    
    // config.filebrowserBrowseUrl = '/#/etc/editor/file-brower/2';
    // config.filebrowserImageBrowseUrl = '/#/etc/editor/file-brower/1';
    config.filebrowserUploadUrl = '/B/EditorFile/UploadFileForCkeditor?type=Files';
    config.filebrowserImageUploadUrl = '/B/EditorFile/UploadFileForCkeditor?type=Images';
    config.filebrowserImage2BrowseUrl = config.filebrowserImageBrowseUrl;
	config.filebrowserImage2UploadUrl = config.filebrowserImageUploadUrl;

    //https://github.com/mathjax/MathJax
    config.mathJaxLib = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML';
};
